<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet  [
	<!ENTITY nbsp   "&#160;">
	<!ENTITY copy   "&#169;">
	<!ENTITY reg    "&#174;">
	<!ENTITY trade  "&#8482;">
	<!ENTITY mdash  "&#8212;">
	<!ENTITY ldquo  "&#8220;">
	<!ENTITY rdquo  "&#8221;">
	<!ENTITY pound  "&#163;">
	<!ENTITY yen    "&#165;">
	<!ENTITY euro   "&#8364;">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:php="http://php.net/xsl">
<xsl:output method="html" encoding="utf-8"/>
<xsl:template name="bee_php_helper" >
  <xsl:param name="id" />
  <div id="id" ></div>
</xsl:template>

<xsl:template name="bee_php_input" >
  <xsl:param name="id" />
  <xsl:call-template name="bee_widget_vinc"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  <xsl:call-template name="bee_widget_events"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  <xsl:call-template name="bee_evt_onChange"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  <xsl:call-template name="bee_evt_onSelect"><xsl:with-param name="id" select="$id" /></xsl:call-template>
</xsl:template>

<xsl:template name="bee_php_label" >
  <xsl:param name="id" />
  <xsl:attribute name="id"><xsl:value-of select="$id" /></xsl:attribute>
  <xsl:call-template name="bee_widget_events"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  <xsl:value-of select="/form/widgets//*[name=$id]/value" />
</xsl:template>

<xsl:template name="bee_php_file" >
  <xsl:param name="id" />
  <xsl:call-template name="bee_widget_vinc"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  <xsl:call-template name="bee_widget_events"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  <xsl:call-template name="bee_evt_onChange"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  <xsl:call-template name="bee_evt_onSelect"><xsl:with-param name="id" select="$id" /></xsl:call-template>
</xsl:template>

<xsl:template name="bee_php_inputarea" >
  <xsl:param name="id" />
  <xsl:call-template name="bee_widget_inc"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  <xsl:call-template name="bee_widget_events"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  <xsl:call-template name="bee_evt_onChange"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  <xsl:call-template name="bee_evt_onSelect"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  <xsl:value-of select="/form/widgets//*[name=$id]/value" />
</xsl:template>

<xsl:template name="bee_php_button">
  <xsl:param name="id" />
  <xsl:call-template name="bee_widget_vinc"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  <xsl:call-template name="bee_widget_events"><xsl:with-param name="id" select="$id" /></xsl:call-template>
</xsl:template>

<xsl:template name="bee_php_check">
  <xsl:param name="id" />
  <xsl:call-template name="bee_widget_vinc"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  <xsl:if test="/form/widgets//*[id=$id]/__checked='1'">
    <xsl:attribute name="checked">checked</xsl:attribute>
  </xsl:if>
  <xsl:call-template name="bee_widget_events"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  <xsl:call-template name="bee_evt_onChange"><xsl:with-param name="id" select="$id" /></xsl:call-template>
</xsl:template>

<xsl:template name="bee_checkGroup">
  <xsl:param name="id" />
  <table>
    <xsl:for-each select="/form/widgets//*[id=$id]/values/value">
      <xsl:variable name="key" select="@key" />
      <xsl:variable name="val" select="." />
      <tr>
        <th scope="row">
          <xsl:value-of select="concat(../../id, '_', .)" /> ** <br />
        	<xsl:call-template name="bee_check"><xsl:with-param name="id" select="concat(../../id, '_', .)" /></xsl:call-template>
        </th>
        <td><xsl:value-of select="../../labels/value[@key=$key]"/></td>
      </tr>
    </xsl:for-each>
  </table>
</xsl:template>

<xsl:template name="bee_php_link">
  <xsl:param name="id" />
    <xsl:call-template name="bee_widget_inc"><xsl:with-param name="id" select="$id" /></xsl:call-template>
    <xsl:call-template name="bee_widget_events"><xsl:with-param name="id" select="$id" /></xsl:call-template>
		<xsl:value-of select="/form/widgets//*[name=$id]//value" />
</xsl:template>

<xsl:template name="bee_php_option">
	<xsl:param name="id" />
  <xsl:call-template name="bee_widget_inc"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  <xsl:call-template name="bee_widget_events"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  <xsl:call-template name="bee_evt_onChange"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  <xsl:if test="/form/widgets//*[id=$id]/notSelectedValue !='' or /form/widgets//*[id=$id]/notSelectedText !=''" >
    <option value="{/form/widgets//*[id=$id]/notSelectedValue}">
      <xsl:value-of select="/form/widgets//*[id=$id]/notSelectedText" />
    </option>
  </xsl:if>
  <xsl:for-each select="/form/widgets//*[id=$id]/listOfValues/value">
    <option value="{@key}">
      <xsl:if test="@key=/form/widgets//*[id=$id]/value"><xsl:attribute name="selected">SELECTED</xsl:attribute></xsl:if>
      <xsl:value-of select="." />
    </option>
  </xsl:for-each>
</xsl:template>


<xsl:template name="bee_php_radio">
  <xsl:param name="id" />
  <xsl:call-template name="bee_widget_vinc"><xsl:with-param name="id" select="$id" /></xsl:call-template>
    <xsl:if test="/form/widgets//*[id=$id]/__checked='1'">
      <xsl:attribute name="checked">checked</xsl:attribute>
    </xsl:if>
    <xsl:call-template name="bee_widget_events"><xsl:with-param name="id" select="$id" /></xsl:call-template>
    <xsl:call-template name="bee_evt_onChange"><xsl:with-param name="id" select="$id" /></xsl:call-template>
</xsl:template>

<xsl:template name="bee_php_radioGroup">
  <xsl:param name="id" />
  <table>
      <xsl:choose>
	      <xsl:when test="/form/widgets//*[id=$id]/orientation=1">
          <tr>
            <xsl:for-each select="/form/widgets//*[id=$id]/values/value">                        
              <xsl:variable name="key" select="@key" />
              <xsl:variable name="val" select="." />
              <td scope="row">
                <input type="radio">
                  <xsl:call-template name="bee_php_radio"><xsl:with-param name="id" select="concat(../../id, '_', .)" /></xsl:call-template>                  
                </input>
                <xsl:value-of select="../../labels/value[@key=$key]"/>
              </td>                          
            </xsl:for-each>
          </tr>
	      </xsl:when>
	      <xsl:otherwise>
          <xsl:for-each select="/form/widgets//*[id=$id]/values/value">
            <tr>            
              <xsl:variable name="key" select="@key" />
              <xsl:variable name="val" select="." />
              <th scope="row">
                <input type="radio">
                  <xsl:call-template name="bee_php_radio"><xsl:with-param name="id" select="concat(../../id, '_', .)" /></xsl:call-template>
                </input>
              </th>
              <td><xsl:value-of select="../../labels/value[@key=$key]"/></td>
            </tr>
          </xsl:for-each>
 	      </xsl:otherwise>
      </xsl:choose>
  </table>
</xsl:template>


<xsl:template name="bee_widget_events">
	<xsl:param name="id" />
	<xsl:call-template name="bee_evt_onBlur"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  <xsl:call-template name="bee_evt_onClick"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  <xsl:call-template name="bee_evt_onDblClick"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  <xsl:call-template name="bee_evt_onFocus"><xsl:with-param name="id" select="$id" /></xsl:call-template>

  <xsl:call-template name="bee_evt_onKeyDown"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  <xsl:call-template name="bee_evt_onKeyPress"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  <xsl:call-template name="bee_evt_onKeyUp"><xsl:with-param name="id" select="$id" /></xsl:call-template>

  <xsl:call-template name="bee_evt_onMouseDown"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  <xsl:call-template name="bee_evt_onMouseMove"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  <xsl:call-template name="bee_evt_onMouseOut"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  <xsl:call-template name="bee_evt_onMouseOver"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  <xsl:call-template name="bee_evt_onMouseUp"><xsl:with-param name="id" select="$id" /></xsl:call-template>
</xsl:template>

<xsl:template name="bee_evt_onBlur">
	<xsl:param name="id" />
    <xsl:if test="/form/widgets//*[id=$id]/onBlurFn/action_type">
    <xsl:attribute name="onBlur">
      <xsl:choose>
        <xsl:when test="/form/widgets//*[id=$id]/onBlurFn/action_type = 1">getPage(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onBlurFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onBlurFn/action_type = 2">loadEvt2Ajax(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onBlurFn/object_name" />', '<xsl:value-of select="/form/widgets//*[id=$id]/onBlurFn/extra_params" />', '<xsl:value-of select="/form/widgets//*[id=$id]/onBlurFn/idToFill" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onBlurFn/action_type = 4">submitForm(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onBlurFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onBlurFn/action_type = 8"><xsl:value-of select="/form/widgets//*[id=$id]/onBlurFn/object_name"/></xsl:when>
      </xsl:choose>
    </xsl:attribute>
  </xsl:if>
</xsl:template>

<xsl:template name="bee_evt_onFocus">
	<xsl:param name="id" />
    <xsl:if test="/form/widgets//*[id=$id]/onFocusFn/action_type">
    <xsl:attribute name="onFocus">
      <xsl:choose>
        <xsl:when test="/form/widgets//*[id=$id]/onFocusFn/action_type = 1">getPage(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onFocusFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onFocusFn/action_type = 2">loadEvt2Ajax(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onFocusFn/object_name" />', '<xsl:value-of select="/form/widgets//*[id=$id]/onFocusFn/extra_params" />', '<xsl:value-of select="/form/widgets//*[id=$id]/onFocusFn/idToFill" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onFocusFn/action_type = 4">submitForm(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onFocusFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onFocusFn/action_type = 8"><xsl:value-of select="/form/widgets//*[id=$id]/onFocusFn/object_name"/></xsl:when>
      </xsl:choose>
    </xsl:attribute>
  </xsl:if>
</xsl:template>

<xsl:template name="bee_evt_onChange">
	<xsl:param name="id" />
  <xsl:if test="/form/widgets//*[id=$id]/onChangeFn/action_type">
    <xsl:attribute name="onChange">
      <xsl:choose>
        <xsl:when test="/form/widgets//*[id=$id]/onChangeFn/action_type = 1">getPage(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onChangeFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onChangeFn/action_type = 2">loadEvt2Ajax(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onChangeFn/object_name" />', '<xsl:value-of select="/form/widgets//*[id=$id]/onChangeFn/extra_params" />', '<xsl:value-of select="/form/widgets//*[id=$id]/onChangeFn/idToFill" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onChangeFn/action_type = 4">submitForm(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onChangeFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onChangeFn/action_type = 8"><xsl:value-of select="/form/widgets//*[id=$id]/onChangeFn/object_name"/></xsl:when>
      </xsl:choose>
    </xsl:attribute>
  </xsl:if>
</xsl:template>

<xsl:template name="bee_evt_onClick">
	<xsl:param name="id" />
  <xsl:if test="/form/widgets//*[id=$id]/onClickFn/action_type">
    <xsl:attribute name="onClick">
      <xsl:choose>
        <xsl:when test="/form/widgets//*[id=$id]/onClickFn/action_type = 1">getPage(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onClickFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onClickFn/action_type = 2">loadEvt2Ajax(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onClickFn/object_name" />', '<xsl:value-of select="/form/widgets//*[id=$id]/onClickFn/extra_params" />',  '<xsl:value-of select="/form/widgets//*[id=$id]/onClickFn/idToFill" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onClickFn/action_type = 4">submitForm(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onClickFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onClickFn/action_type = 8"><xsl:value-of select="/form/widgets//*[id=$id]/onClickFn/object_name"/></xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onClickFn/action_type = 16">submitFormEvt2Ajax(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onClickFn/object_name" />',  '<xsl:value-of select="/form/widgets//*[id=$id]/onClickFn/extra_params" />')</xsl:when>
      </xsl:choose>
    </xsl:attribute>
  </xsl:if>
</xsl:template>

<xsl:template name="bee_evt_onDblClick">
	<xsl:param name="id" />
  <xsl:if test="/form/widgets//*[id=$id]/onDblClickFn/action_type">
    <xsl:attribute name="onDblClick">
      <xsl:choose>
        <xsl:when test="/form/widgets//*[id=$id]/onDblClickFn/action_type = 1">getPage(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onDblClickFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onDblClickFn/action_type = 2">loadAjax(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onDblClickFn/object_name" />', '<xsl:value-of select="/form/widgets//*[id=$id]/onDblClickFn/extra_params" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onDblClickFn/action_type = 4">submitForm(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onDblClickFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onDblClickFn/action_type = 8"><xsl:value-of select="/form/widgets//*[id=$id]/onDblClickFn/object_name"/></xsl:when>
      </xsl:choose>
    </xsl:attribute>
  </xsl:if>
</xsl:template>

<xsl:template name="bee_evt_onFocus_old">
	<xsl:param name="id" />
  <xsl:if test="/form/widgets//*[id=$id]/onFocusFn/action_type">
    <xsl:attribute name="onFocus">
      <xsl:choose>
        <xsl:when test="/form/widgets//*[id=$id]/onFocusFn/action_type = 1">getPage(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onFocusFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onFocusFn/action_type = 2">loadAjax(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onFocusFn/object_name" />', '<xsl:value-of select="/form/widgets//*[id=$id]/onFocusFn/extra_params" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onFocusFn/action_type = 4">submitForm(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onFocusFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onFocusFn/action_type = 8"><xsl:value-of select="/form/widgets//*[id=$id]/onFocusFn/object_name"/></xsl:when>
      </xsl:choose>
    </xsl:attribute>
  </xsl:if>
</xsl:template>

<xsl:template name="bee_evt_onKeyDown">
	<xsl:param name="id" />
    <xsl:if test="/form/widgets//*[id=$id]/onKeyDownFn/action_type">
    <xsl:attribute name="onKeyDown">
      <xsl:choose>
        <xsl:when test="/form/widgets//*[id=$id]/onKeyDownFn/action_type = 1">getPage(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onKeyDownFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onKeyDownFn/action_type = 2">loadAjax(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onKeyDownFn/object_name" />', '<xsl:value-of select="/form/widgets//*[id=$id]/onKeyDownFn/extra_params" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onKeyDownFn/action_type = 4">submitForm(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onKeyDownFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onKeyDownFn/action_type = 8"><xsl:value-of select="/form/widgets//*[id=$id]/onKeyDownFn/object_name"/></xsl:when>
      </xsl:choose>
    </xsl:attribute>
  </xsl:if>
</xsl:template>

<xsl:template name="bee_evt_onKeyPress">
	<xsl:param name="id" />
  <xsl:if test="/form/widgets//*[id=$id]/onKeyPressFn/action_type">
    <xsl:attribute name="onKeyPress">
      <xsl:choose>
        <xsl:when test="/form/widgets//*[id=$id]/onKeyPressFn/action_type = 1">getPage(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onKeyPressFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onKeyPressFn/action_type = 2">loadAjax(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onKeyPressFn/object_name" />', '<xsl:value-of select="/form/widgets//*[id=$id]/onKeyPressFn/extra_params" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onKeyPressFn/action_type = 4">submitForm(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onKeyPressFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onKeyPressFn/action_type = 8"><xsl:value-of select="/form/widgets//*[id=$id]/onKeyPressFn/object_name"/></xsl:when>
      </xsl:choose>
    </xsl:attribute>
  </xsl:if>
</xsl:template>

<xsl:template name="bee_evt_onKeyUp">
	<xsl:param name="id" />
  <xsl:if test="/form/widgets//*[id=$id]/onKeyUpFn/action_type">
    <xsl:attribute name="onKeyUp">
      <xsl:choose>
        <xsl:when test="/form/widgets//*[id=$id]/onKeyUpFn/action_type = 1">getPage(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onKeyUpFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onKeyUpFn/action_type = 2">loadEvt2Ajax(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onKeyUpFn/object_name" />', '<xsl:value-of select="/form/widgets//*[id=$id]/onBlurFn/extra_params" />', '<xsl:value-of select="/form/widgets//*[id=$id]/onKeyUpFn/idToFill" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onKeyUpFn/action_type = 4">submitForm(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onKeyUpFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onKeyUpFn/action_type = 8"><xsl:value-of select="/form/widgets//*[id=$id]/onKeyUpFn/object_name"/></xsl:when>
      </xsl:choose>
    </xsl:attribute>
  </xsl:if>
</xsl:template>

<xsl:template name="bee_evt_onMouseDown">
	<xsl:param name="id" />
  <xsl:if test="/form/widgets//*[id=$id]/onMouseDownFn/action_type">
    <xsl:attribute name="onMouseDown">
      <xsl:choose>
        <xsl:when test="/form/widgets//*[id=$id]/onMouseDownFn/action_type = 1">getPage(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onMouseDownFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onMouseDownFn/action_type = 2">loadAjax(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onMouseDownFn/object_name" />', '<xsl:value-of select="/form/widgets//*[id=$id]/onMouseDownFn/extra_params" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onMouseDownFn/action_type = 4">submitForm(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onMouseDownFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onMouseDownFn/action_type = 8"><xsl:value-of select="/form/widgets//*[id=$id]/onMouseDownFn/object_name"/></xsl:when>
      </xsl:choose>
    </xsl:attribute>
  </xsl:if>
</xsl:template>

<xsl:template name="bee_evt_onMouseMove">
	<xsl:param name="id" />
  <xsl:if test="/form/widgets//*[id=$id]/onMouseMoveFn/action_type">
    <xsl:attribute name="onMouseMove">
      <xsl:choose>
        <xsl:when test="/form/widgets//*[id=$id]/onMouseMoveFn/action_type = 1">getPage(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onMouseMoveFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onMouseMoveFn/action_type = 2">loadAjax(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onMouseMoveFn/object_name" />', '<xsl:value-of select="/form/widgets//*[id=$id]/onMouseMoveFn/extra_params" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onMouseMoveFn/action_type = 4">submitForm(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onMouseMoveFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onMouseMoveFn/action_type = 8"><xsl:value-of select="/form/widgets//*[id=$id]/onMouseMoveFn/object_name"/></xsl:when>
      </xsl:choose>
    </xsl:attribute>
  </xsl:if>
</xsl:template>

<xsl:template name="bee_evt_onMouseOut">
	<xsl:param name="id" />
  <xsl:if test="/form/widgets//*[id=$id]/onMouseOutFn/action_type">
    <xsl:attribute name="onMouseOut">
      <xsl:choose>
        <xsl:when test="/form/widgets//*[id=$id]/onMouseOutFn/action_type = 1">getPage(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onMouseOutFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onMouseOutFn/action_type = 2">loadAjax(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onMouseOutFn/object_name" />', '<xsl:value-of select="/form/widgets//*[id=$id]/onMouseOutFn/extra_params" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onMouseOutFn/action_type = 4">submitForm(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onMouseOutFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onMouseOutFn/action_type = 8"><xsl:value-of select="/form/widgets//*[id=$id]/onMouseOutFn/object_name"/></xsl:when>
      </xsl:choose>
    </xsl:attribute>
  </xsl:if>
</xsl:template>

<xsl:template name="bee_evt_onMouseOver">
	<xsl:param name="id" />
  <xsl:if test="/form/widgets//*[id=$id]/onMouseOverFn/action_type">
    <xsl:attribute name="onMouseOver">
      <xsl:choose>
        <xsl:when test="/form/widgets//*[id=$id]/onMouseOverFn/action_type = 1">getPage(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onMouseOverFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onMouseOverFn/action_type = 2">loadAjax(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onMouseOverFn/object_name" />', '<xsl:value-of select="/form/widgets//*[id=$id]/onMouseOverFn/extra_params" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onMouseOverFn/action_type = 4">submitForm(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onMouseOverFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onMouseOverFn/action_type = 8"><xsl:value-of select="/form/widgets//*[id=$id]/onMouseOverFn/object_name"/></xsl:when>
      </xsl:choose>
    </xsl:attribute>
  </xsl:if>
</xsl:template>

<xsl:template name="bee_evt_onMouseUp">
	<xsl:param name="id" />
  <xsl:if test="/form/widgets//*[id=$id]/onMouseUpFn/action_type">
    <xsl:attribute name="onMouseUp">
      <xsl:choose>
        <xsl:when test="/form/widgets//*[id=$id]/onMouseUpFn/action_type = 1">getPage(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onMouseUpFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onMouseUpFn/action_type = 2">loadAjax(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onMouseUpFn/object_name" />', '<xsl:value-of select="/form/widgets//*[id=$id]/onMouseUpFn/extra_params" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onMouseUpFn/action_type = 4">submitForm(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onMouseUpFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onMouseUpFn/action_type = 8"><xsl:value-of select="/form/widgets//*[id=$id]/onMouseUpFn/object_name"/></xsl:when>
      </xsl:choose>
    </xsl:attribute>
  </xsl:if>
</xsl:template>

<xsl:template name="bee_evt_onSelect">
	<xsl:param name="id" />
	<xsl:if test="/form/widgets//*[id=$id]/onSelectFn/action_type">
    <xsl:attribute name="onSelect">
      <xsl:choose>
        <xsl:when test="/form/widgets//*[id=$id]/onSelectFn/action_type = 1">getPage(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onSelectFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onSelectFn/action_type = 2">loadAjax(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onSelectFn/object_name" />', '<xsl:value-of select="/form/widgets//*[id=$id]/onSelectFn/extra_params" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onSelectFn/action_type = 4">submitForm(this, '<xsl:value-of select="/form/widgets//*[id=$id]/onSelectFn/object_name" />')</xsl:when>
        <xsl:when test="/form/widgets//*[id=$id]/onSelectFn/action_type = 8"><xsl:value-of select="/form/widgets//*[id=$id]/onSelectFn/object_name"/></xsl:when>
      </xsl:choose>
    </xsl:attribute>
  </xsl:if>
</xsl:template>

<xsl:template name="bee_widget_vinc" >
	<xsl:param name="id" />
	<xsl:attribute name="value"><xsl:value-of select="/form/widgets//*[id=$id]/value" /></xsl:attribute>
  <xsl:call-template name="bee_widget_inc"><xsl:with-param name="id" select="$id" /></xsl:call-template>
</xsl:template>


<xsl:template name="bee_widget_inc">
	<xsl:param name="id" />
  <xsl:attribute name="id"><xsl:value-of select="$id" /></xsl:attribute>
  <xsl:attribute name="name"><xsl:value-of select="/form/widgets//*[id=$id]/name" /></xsl:attribute>
  <xsl:if test="/form/widgets//*[id=$id]/class != ''">
  	<xsl:attribute name="class"><xsl:value-of select="/form/widgets//*[id=$id]/class" /></xsl:attribute>
  </xsl:if>
</xsl:template>

<xsl:template name="bee_widget_vic">
	<xsl:param name="id" />
  <xsl:attribute name="value"><xsl:value-of select="/form/widgets//*[id=$id]/value" /></xsl:attribute>
  <xsl:attribute name="id"><xsl:value-of select="$id" /></xsl:attribute>
  <xsl:if test="/form/widgets//*[id=$id]/class != ''">
  	<xsl:attribute name="class"><xsl:value-of select="/form/widgets//*[id=$id]/class" /></xsl:attribute>
  </xsl:if>
</xsl:template>

<xsl:template name="bee_grid">
<xsl:param name="gridID"></xsl:param>
<xsl:variable name="grid" select="/form/widgets//*[id=$gridID]"></xsl:variable>
oooo
<table>
  <xsl:if test="$grid/caption != ''">
    <caption>
      <xsl:value-of select="$grid/caption" />
    </caption>
  </xsl:if>
  <tr>
    <xsl:choose>
      <xsl:when test="count($grid/columns/value) > 0">
		    <xsl:for-each select="$grid/columns/value">
		      <xsl:variable name="column" select="." />
		      <th scope="col">
		        <xsl:if test="$column/width">
		          <xsl:attribute name="width"><xsl:value-of select="$column/width" /></xsl:attribute>
		        </xsl:if>
		        <a href="index.php?sys_action=grid_set_order&amp;grid_order_field={$column/name}&amp;grid_order={/form/variables/grid_anti_order}&amp;grid_order_type=text"><xsl:value-of select="$column/caption" /></a>&nbsp;
		        <xsl:if test="/form/variables/grid_order_field = $column/name">
		          <img><xsl:attribute name="src">/xslt/img/order<xsl:value-of select="substring(/form/variables/grid_order, 1, 3)"/>.gif</xsl:attribute></img>
		        </xsl:if>
		      </th>    
		    </xsl:for-each>
		  </xsl:when>
		  <xsl:otherwise>
        <xsl:for-each select="$grid/DAORow/*[substring(name(), 1, 2) != '__']">
          <th scope="col">
            <a href="index.php?sys_action=grid_set_order&amp;grid_order_field={name()}&amp;grid_order={/form/variables/grid_anti_order}&amp;grid_order_type=text"><xsl:value-of select="name()" /></a>&nbsp;
            <xsl:if test="/form/variables/grid_order_field = name()">
              <img><xsl:attribute name="src">/xslt/img/order<xsl:value-of select="substring(/form/variables/grid_order, 1, 3)"/>.gif</xsl:attribute></img>
            </xsl:if>
          </th>    
        </xsl:for-each>         		  
		  </xsl:otherwise>
		</xsl:choose>
  </tr>
  <xsl:for-each select="$grid/data/row">
  <xsl:sort select="*[name(.)=/form/variables/grid_order_field]" order="{/form/variables/grid_order}" />
    <xsl:variable name="stil">
      <xsl:choose>
        <xsl:when test="position() mod 2 = 0">par</xsl:when>
        <xsl:otherwise>nepar</xsl:otherwise>
      </xsl:choose>
    </xsl:variable>
    <xsl:variable name="row" select="." />
    <tr class="{$stil}">
      <xsl:choose>
        <xsl:when test="count($grid/columns/value) > 0">      
		      <xsl:for-each select="$grid/columns/value">
		        <xsl:variable name="columnName" select="name" />
		        <td><xsl:value-of select="$row/*[name()=$columnName]" /></td>
		      </xsl:for-each>
        </xsl:when>
        <xsl:otherwise>
	        <xsl:for-each select="$grid/DAORow/*[substring(name(), 1, 2) != '__']">
	          <xsl:variable name="columnName" select="name()" />
	          <td><xsl:value-of select="$row/*[name()=$columnName]" /></td>
	        </xsl:for-each>        
        </xsl:otherwise>
      </xsl:choose>
      <xsl:if test="php:functionString('bee\bitwiseAND', $grid/showButtons, 1) = 1">
        <td><a href="index.php?__form={/form/widgets//*[id=$gridID]/detailFormName}&amp;sys_action=show&amp;{/form/widgets//*[id=$gridID]/detailLinkField}={$row/*[name()=/form/widgets//*[id=$gridID]/detailLinkField]}&amp;__frm_back={/form/variables/sys_page}&amp;__noload=true">edit</a></td>
      </xsl:if>
      <xsl:if test="php:functionString('bee\bitwiseAND', $grid/showButtons, 2) = 2">
        <td><a href="index.php?__form={/form/widgets//*[id=$gridID]/detailFormName}&amp;sys_action=delete&amp;{/form/widgets//*[id=$gridID]/detailLinkField}={$row/*[name()=/form/widgets//*[id=$gridID]/detailLinkField]}&amp;__frm_back={/form/variables/sys_page}&amp;__noload=true">delete</a></td>
      </xsl:if>
    </tr>
  </xsl:for-each>
<xsl:value-of select="$grid" />+++
  <xsl:for-each select="$grid/data/value">
  <xsl:sort select="*[name(.)=/form/variables/grid_order_field]" order="{/form/variables/grid_order}" />
    <xsl:variable name="stil">
      <xsl:choose>
        <xsl:when test="position() mod 2 = 0">par</xsl:when>
        <xsl:otherwise>nepar</xsl:otherwise>
      </xsl:choose>
    </xsl:variable>
    <xsl:variable name="row" select="." />
    <tr class="{$stil}">
      <xsl:choose>
        <xsl:when test="count($grid/columns/value) > 0">      
          <xsl:for-each select="$grid/columns/value">
            <xsl:variable name="columnName" select="name" />
            <td><xsl:value-of select="$row/*[name()=$columnName]" /></td>
          </xsl:for-each>
        </xsl:when>
        <xsl:otherwise>
          <xsl:for-each select="$grid/DAORow/*[substring(name(), 1, 2) != '__']">
            <xsl:variable name="columnName" select="name()" />
            <td><xsl:value-of select="$row/*[name()=$columnName]" /></td>
          </xsl:for-each>        
        </xsl:otherwise>
      </xsl:choose>
      <xsl:if test="php:functionString('bee\bitwiseAND', $grid/showButtons, 1) = 1">
        <td><a href="index.php?__form={/form/widgets//*[id=$gridID]/detailFormName}&amp;sys_action=show&amp;{/form/widgets//*[id=$gridID]/detailLinkField}={$row/*[name()=/form/widgets//*[id=$gridID]/detailLinkField]}&amp;__frm_back={/form/variables/sys_page}&amp;__noload=true">edit</a></td>
      </xsl:if>
      <xsl:if test="php:functionString('bee\bitwiseAND', $grid/showButtons, 2) = 2">
        <td><a href="index.php?__form={/form/widgets//*[id=$gridID]/detailFormName}&amp;sys_action=delete&amp;{/form/widgets//*[id=$gridID]/detailLinkField}={$row/*[name()=/form/widgets//*[id=$gridID]/detailLinkField]}&amp;__frm_back={/form/variables/sys_page}&amp;__noload=true">delete</a></td>
      </xsl:if>
    </tr>
  </xsl:for-each>



  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td class="pager">
    <xsl:attribute name="colspan">
	    <xsl:choose>
	      <xsl:when test="count($grid/columns/value) > 0">
	        <xsl:value-of select="count($grid/columns/value) + 2"/>
	      </xsl:when>
	      <xsl:otherwise>
	        <xsl:value-of select="count($grid/DAORow/*[substring(name(), 1, 2) != '__']) + 2"/>
	      </xsl:otherwise>
	    </xsl:choose>      
    </xsl:attribute>
    
    <table width="100%"><tr>
      <xsl:if test="$grid/num_rows &gt; $grid/grid_step"><td>
        <xsl:if test="$grid/page_no &gt; $grid/ffwd_step"><a href="index.php?sys_action=grid_first">&lt;&lt;&lt;</a></xsl:if>
        <xsl:if test="$grid/page_no &gt;= $grid/ffwd_step">&nbsp;<a href="index.php?sys_action=grid_FBWD">&lt;&lt;</a></xsl:if>
        <xsl:if test="$grid/page_no &gt; 0">&nbsp;<a href="index.php?sys_action=grid_prev">&lt;</a></xsl:if>&nbsp;
        <xsl:if test="$grid/page_no &gt; 3">&nbsp;<a href="index.php?sys_action=grid_goto&amp;page_no={$grid/page_no - 4}"> <xsl:value-of select="$grid/page_no - 3" /></a></xsl:if>
        <xsl:if test="$grid/page_no &gt; 2">&nbsp;<a href="index.php?sys_action=grid_goto&amp;page_no={$grid/page_no - 3}"> <xsl:value-of select="$grid/page_no - 2" /></a></xsl:if>
        <xsl:if test="$grid/page_no &gt; 1">&nbsp;<a href="index.php?sys_action=grid_goto&amp;page_no={$grid/page_no - 2}"> <xsl:value-of select="$grid/page_no - 1" /></a></xsl:if>
        <xsl:if test="$grid/page_no &gt; 0" >&nbsp;<a href="index.php?sys_action=grid_goto&amp;page_no={$grid/page_no - 1}"> <xsl:value-of select="$grid/page_no" /></a></xsl:if>
        &nbsp;<xsl:value-of select="$grid/page_no + 1" />&nbsp;
        <xsl:if test="$grid/page_no &lt; $grid/num_rows div $grid/grid_step - 1"><a href="index.php?sys_action=grid_goto&amp;page_no={$grid/page_no + 1}"><xsl:value-of select="$grid/page_no + 2" /></a></xsl:if>
        <xsl:if test="$grid/page_no &lt; $grid/num_rows div $grid/grid_step - 2">&nbsp;<a href="index.php?sys_action=grid_goto&amp;page_no={$grid/page_no + 2}"> <xsl:value-of select="$grid/page_no + 3" /></a></xsl:if>
        <xsl:if test="$grid/page_no &lt; $grid/num_rows div $grid/grid_step - 3">&nbsp;<a href="index.php?sys_action=grid_goto&amp;page_no={$grid/page_no + 3}"> <xsl:value-of select="$grid/page_no + 4" /></a></xsl:if>
        <xsl:if test="$grid/page_no &lt; $grid/num_rows div $grid/grid_step - 4">&nbsp;<a href="index.php?sys_action=grid_goto&amp;page_no={$grid/page_no + 4}"> <xsl:value-of select="$grid/page_no + 5" /></a></xsl:if>&nbsp;
        <xsl:if test="$grid/page_no &lt; $grid/num_rows div $grid/grid_step - 1">&nbsp;<a href="index.php?sys_action=grid_next">&gt;</a></xsl:if>
        <xsl:if test="$grid/page_no &lt; $grid/num_rows div $grid/grid_step - $grid/ffwd_step">&nbsp;<a href="index.php?sys_action=grid_FFWD">&gt;&gt; </a></xsl:if>
        <xsl:if test="$grid/page_no &lt; $grid/num_rows div $grid/grid_step - $grid/ffwd_step - 1">&nbsp;<a href="index.php?sys_action=grid_last">&gt;&gt;&gt;</a></xsl:if>
        </td>
      </xsl:if>
      <td class="inpRight">
        <xsl:choose>
          <xsl:when  test="$grid/num_rows &gt; ($grid/page_no + 1) * $grid/grid_step">
            <xsl:value-of select="$grid/page_no * $grid/grid_step + 1"/> - <xsl:value-of select="($grid/page_no + 1) * $grid/grid_step"/> of <xsl:value-of select="$grid/num_rows"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="$grid/page_no * $grid/grid_step + 1"/> - <xsl:value-of select="$grid/num_rows"/> of <xsl:value-of select="$grid/num_rows"/>
          </xsl:otherwise>
        </xsl:choose>
      </td></tr></table>
    </td>
  </tr>
</table>
</xsl:template>

<xsl:template name="bee_ajaxGrid">
<xsl:param name="gridID"></xsl:param>
<xsl:variable name="grid" select="/form/widgets//*[id=$gridID]"></xsl:variable>
	<div class="outerGridBorder1">
	<div class="outerGridBorder2">
	<div class="innerGridBorder">
	<table cellspacing="0" width="100%">
	      <tr>
	    <th class="columnCaption" width="25" scope="col" onclick='javascript:handleGridEvent({{ "__ajax": "{form/variables/__ajax}", "sys_action": "grid_set_order", "grid_order_field": "group_id", "grid_order": "{/form/variables/grid_anti_order}" }}) '>group
	      <xsl:if test="/form/variables/grid_order_field = 'group_id'">
	        <img><xsl:attribute name="src">/xslt/img/arrow<xsl:value-of select="substring(/form/variables/grid_order, 1, 3)"/>.gif</xsl:attribute></img>
	      </xsl:if>
	    </th>
	    <th class="columnCaption" width="100" scope="col" onclick='javascript:handleGridEvent({{ "__ajax": "{form/variables/__ajax}", "sys_action": "grid_set_order", "grid_order_field": "sys_page", "grid_order": "{/form/variables/grid_anti_order}" }}) '>page
	      <xsl:if test="/form/variables/grid_order_field = 'sys_page'">
	        <img><xsl:attribute name="src">/xslt/img/arrow<xsl:value-of select="substring(/form/variables/grid_order, 1, 3)"/>.gif</xsl:attribute></img>
	      </xsl:if>
	    </th>
	    <th class="columnCaption" width="200" scope="col" onclick='javascript:handleGridEvent({{ "__ajax": "{form/variables/__ajax}", "sys_action": "grid_set_order", "grid_order_field": "sys_action", "grid_order": "{/form/variables/grid_anti_order}" }}) '>action
	      <xsl:if test="/form/variables/grid_order_field = 'sys_action'">
	        <img><xsl:attribute name="src">/xslt/img/arrow<xsl:value-of select="substring(/form/variables/grid_order, 1, 3)"/>.gif</xsl:attribute></img>
	      </xsl:if>
	    </th>
	    <th class="columnCaption" width="25" scope="col" onclick='javascript:handleGridEvent({{ "__ajax": "{form/variables/__ajax}", "sys_action": "grid_set_order", "grid_order_field": "per_den", "grid_order": "{/form/variables/grid_anti_order}" }}) '>permission
	      <xsl:if test="/form/variables/grid_order_field = 'per_den'">
	        <img><xsl:attribute name="src">/xslt/img/arrow<xsl:value-of select="substring(/form/variables/grid_order, 1, 3)"/>.gif</xsl:attribute></img>
	      </xsl:if>
	    </th>
	    <th colspan="2" class="columnCaption">&nbsp;</th>
	  </tr>
	  <xsl:for-each select="form/tables/bee_gr_task/row">
	    <xsl:sort select="*[name(.)=/form/variables/grid_order_field]" order="{/form/variables/grid_order}" data-type="{/form/variables/grid_order_type}"/>
	    <xsl:variable name="stil">
	      <xsl:choose>
	        <xsl:when test="position() mod 2 = 0">par</xsl:when>
	        <xsl:otherwise>nepar</xsl:otherwise>
	      </xsl:choose>
	    </xsl:variable>
	    <xsl:variable name="per_den" select="per_den" />
	    <xsl:variable name="group" select="group_id" />
	    <tr class="{$stil}">
	      <td><xsl:value-of select="/form/arrays/group/value[@key=$group]"/></td>
	      <td><xsl:value-of select="sys_page"/></td>
	      <td><xsl:value-of select="sys_action"/></td>
	      <td><xsl:value-of select="/form/arrays/perden/value[@key=$per_den]"/></td>
	      <td align="center" class="gumb" width="25px" onclick="location.href='index.php?__form=editGroupRights&amp;__frm_back={/form/variables/sys_page}&amp;id={id}&amp;__noload=true'">edit</td>
	      <td align="center" class="gumb" width="25px" onclick="location.href='index.php?__form=editGroupRights&amp;__frm_back={/form/variables/sys_page}&amp;id={id}&amp;__noload=true&amp;sys_action=delete'">delete</td>
	    </tr>
	  </xsl:for-each>  
	  <tr height="20px">
	    <td>&nbsp;</td>
	    <td>&nbsp;</td>
	    <td>&nbsp;</td>
	  </tr>
	  <tr>
	    <td colspan="5" class="pager">
	    <table width="100%">
	     <tr>
	     <xsl:if test="/form/variables/grid_num_rows &gt; /form/variables/app_grid_step">
	      <td>
	      <table><tr>
	        <xsl:if test="/form/variables/grid_page_no &gt; /form/variables/app_FFWD_STEP"><td style="border:dotted #999 thin; cursor:pointer" onclick='javascript:handleGridEvent({{ "__ajax": "{form/variables/__ajax}", "sys_action": "grid_first" }}) '>&lt;&lt;&lt;</td></xsl:if>
	        <xsl:if test="/form/variables/grid_page_no &gt;= /form/variables/app_FFWD_STEP"><td style="border:dotted #999 thin; cursor:pointer" onclick='javascript:handleGridEvent({{ "__ajax": "{form/variables/__ajax}", "sys_action": "grid_FBWD" }}) '>&lt;&lt;</td></xsl:if>
	        <xsl:if test="/form/variables/grid_page_no &gt; 0"><td style="border:dotted #999 thin; cursor:pointer" onclick='javascript:handleGridEvent({{ "__ajax": "{form/variables/__ajax}", "sys_action": "grid_prev" }}) '>&lt;</td></xsl:if>&nbsp;
	        <xsl:if test="/form/variables/grid_page_no &gt; 3"><td style="border:dotted #999 thin; cursor:pointer" onclick='javascript:handleGridEvent({{ "__ajax": "{form/variables/__ajax}", "sys_action": "grid_goto", "page_no": "{form/variables/grid_page_no - 4}" }}) '><xsl:value-of select="form/variables/grid_page_no - 3" /></td></xsl:if>
	        <xsl:if test="/form/variables/grid_page_no &gt; 2"><td style="border:dotted #999 thin; cursor:pointer" onclick='javascript:handleGridEvent({{ "__ajax": "{form/variables/__ajax}", "sys_action": "grid_goto", "page_no": "{form/variables/grid_page_no - 3}" }}) '><xsl:value-of select="form/variables/grid_page_no - 2" /></td></xsl:if>
	        <xsl:if test="/form/variables/grid_page_no &gt; 1"><td style="border:dotted #999 thin; cursor:pointer" onclick='javascript:handleGridEvent({{ "__ajax": "{form/variables/__ajax}", "sys_action": "grid_goto", "page_no": "{form/variables/grid_page_no - 2}" }}) '><xsl:value-of select="form/variables/grid_page_no - 1" /></td></xsl:if>
	        <xsl:if test="/form/variables/grid_page_no &gt; 0" ><td style="border:dotted #999 thin; cursor:pointer" onclick='javascript:handleGridEvent({{ "__ajax": "{form/variables/__ajax}", "sys_action": "grid_goto", "page_no": "{form/variables/grid_page_no - 1}" }}) '><xsl:value-of select="form/variables/grid_page_no" /></td></xsl:if><td>
	        <xsl:value-of select="form/variables/grid_page_no + 1" /></td>
	        <xsl:if test="/form/variables/grid_page_no &lt; /form/variables/grid_num_rows div /form/variables/app_grid_step - 1"><td style="border:dotted #999 thin; cursor:pointer" onclick='javascript:handleGridEvent({{ "__ajax": "{form/variables/__ajax}", "sys_action": "grid_goto", "page_no": "{form/variables/grid_page_no + 1}" }}) '><xsl:value-of select="form/variables/grid_page_no + 2" /></td></xsl:if>
	        <xsl:if test="/form/variables/grid_page_no &lt; /form/variables/grid_num_rows div /form/variables/app_grid_step - 2"><td style="border:dotted #999 thin; cursor:pointer" onclick='javascript:handleGridEvent({{ "__ajax": "{form/variables/__ajax}", "sys_action": "grid_goto", "page_no": "{form/variables/grid_page_no + 2}" }}) '><xsl:value-of select="form/variables/grid_page_no + 3" /></td></xsl:if>
	        <xsl:if test="/form/variables/grid_page_no &lt; /form/variables/grid_num_rows div /form/variables/app_grid_step - 3"><td style="border:dotted #999 thin; cursor:pointer" onclick='javascript:handleGridEvent({{ "__ajax": "{form/variables/__ajax}", "sys_action": "grid_goto", "page_no": "{form/variables/grid_page_no + 3}" }}) '><xsl:value-of select="form/variables/grid_page_no + 4" /></td></xsl:if>
	        <xsl:if test="/form/variables/grid_page_no &lt; /form/variables/grid_num_rows div /form/variables/app_grid_step - 4"><td style="border:dotted #999 thin; cursor:pointer" onclick='javascript:handleGridEvent({{ "__ajax": "{form/variables/__ajax}", "sys_action": "grid_goto", "page_no": "{form/variables/grid_page_no + 4}" }}) '><xsl:value-of select="form/variables/grid_page_no + 5" /></td></xsl:if>
	        <xsl:if test="/form/variables/grid_page_no &lt; /form/variables/grid_num_rows div /form/variables/app_grid_step - 1"><td style="border:dotted #999 thin; cursor:pointer" onclick='javascript:handleGridEvent({{ "__ajax": "{form/variables/__ajax}", "sys_action": "grid_next" }}) '>&gt;</td></xsl:if>
	        <xsl:if test="/form/variables/grid_page_no &lt; /form/variables/grid_num_rows div /form/variables/app_grid_step - /form/variables/app_FFWD_STEP"><td style="border:dotted #999 thin; cursor:pointer" onclick='javascript:handleGridEvent({{ "__ajax": "{form/variables/__ajax}", "sys_action": "grid_FFWD" }}) '>&gt;&gt;</td></xsl:if>
	        <xsl:if test="/form/variables/grid_page_no &lt; /form/variables/grid_num_rows div /form/variables/app_grid_step - /form/variables/app_FFWD_STEP - 1"><td style="border:dotted #999 thin; cursor:pointer" onclick='javascript:handleGridEvent({{ "__ajax": "{form/variables/__ajax}", "sys_action": "grid_last" }}) '>&gt;&gt;&gt;</td></xsl:if>
	      </tr></table>
	      </td>      
	     </xsl:if>
	      <td class="inpRight">
	        <xsl:choose>
	          <xsl:when  test="form/variables/grid_total_rows &gt; (form/variables/grid_page_no + 1) * form/variables/app_grid_step">
	            <xsl:value-of select="form/variables/grid_page_no * form/variables/app_grid_step + 1"/> - <xsl:value-of select="(form/variables/grid_page_no + 1) * form/variables/app_grid_step"/> of <xsl:value-of select="form/variables/grid_total_rows"/>
	          </xsl:when>
	          <xsl:otherwise>
	            <xsl:value-of select="form/variables/grid_page_no * form/variables/app_grid_step + 1"/> - <xsl:value-of select="form/variables/grid_total_rows"/> of <xsl:value-of select="form/variables/grid_total_rows"/>
	          </xsl:otherwise>
	        </xsl:choose>
	      </td>
	     </tr>
	    </table>
	    </td>
	  </tr>
	 </table>
	</div>
	</div>
	</div>
</xsl:template>
</xsl:stylesheet>